/*
 * File Name：EpaperInfo.java
 * Copyright：Copyright 2008-2015 CiWong.Inc. All Rights Reserved.
 * Description： EpaperInfo.java
 * Modify By：bin
 * Modify Date：2015年1月16日
 * Modify Type：Add
 */
package com.ciwong.epaper.modules.epaper.bean;

import com.ciwong.mobilelib.bean.BaseBean;

import java.util.List;

/**
 * 电子书信息
 *
 * @author bin
 * @version ciwong v.1.0 2015年1月16日
 * @since ciwong v.1.0
 */
public class EpaperInfo extends BaseBean {

//    private static final long serialVersionUID = 8186738137537993086L;
    /**
     * 是否放到书桌：1是，0否。
     */
    public int isBookCase;
    /**
     * 产品ID
     */
    public String productId;

    /**
     * 产品名称
     */
    private String productName;

    /**
     * 产品封面
     */
    private String cover;

    /**
     * 资源包ID
     */
    private String packageId;

    /**
     * 书籍描述
     */
    private String bookIntro;

    /**
     * 平台ID,用户布置作业回传
     */
    private int appId;

    /**
     * 平台ID,用户布置作业回传
     */
    private long length;

    /**
     * 资源包中章节数量
     */
    private int size;

    /**
     * 资源包类型
     */
    private int packageType;

    /**
     * 是否免费（1:免费 0:收费）
     */
    private int isFree;
    /**
     * 服务失效时间
     */
    private String expire_time;
    /**
     * 服务包是否失效，1未失效，0已失效
     */
    private int isExpire;
    /**
     * 适用年级
     */
    private int grade;

    /**
     * 排序值。1表示推送到学校  0:未推送
     */
    private int sort;

    /**
     * 是否被用户添加
     */
    private boolean isAdded;

    /**
     * 书籍书籍分类,1教材同步 2课外拓展 -1为所有
     */
    private int bookType;
    /**
     * 书籍创建团队ID
     */
    private int teamId;
    /**
     * 书籍创建团队名称
     */
    private String teamName;
    /**
     * 所属省ID
     */
    private int provId;
    /**
     * 所属省名称
     */
    private String provName;
    /**
     * 所属城市ID
     */
    private int cityId;
    /**
     * 所属城市名称
     */
    private String cityName;
    /**
     * 学段ID
     */
    private int period;
    /**
     * 学科ID
     */
    private int subjectId;

    /**
     * 0:通读 1：考试 2：选读
     */
    private int required;

    private Server server;


    private int serverId;

    private int salesType;

    private String serverName;

    private String gradeName;

    private String periodName;

    private String subjectName;


    /**
     * 本地辅助字段，是否是添加入口
     */
    private boolean isAddEntrance;


    private boolean isSelectDelete;

    public String getExpire_time() {
        return expire_time;
    }

    public void setExpire_time(String expire_time) {
        this.expire_time = expire_time;
    }

    public int getIsExpire() {
        return isExpire;
    }

    public void setIsExpire(int isExpire) {
        this.isExpire = isExpire;
    }

    public void setSelectDelete(boolean selectDelete) {
        isSelectDelete = selectDelete;
    }

    public boolean isSelectDelete() {
        return isSelectDelete;
    }

    public void setAddEntrance(boolean addEntrance) {
        isAddEntrance = addEntrance;
    }

    public boolean isAddEntrance() {
        return isAddEntrance;
    }

    public void setRequired(int required) {
        this.required = required;
    }

    public int getRequired() {
        return required;
    }

    public int getIsFree() {
        return isFree;
    }

    public void setIsFree(int isFree) {
        this.isFree = isFree;
    }

    public Server getServer() {
        return server;
    }

    public void setServer(Server server) {
        this.server = server;
    }

    public int getServerId() {
        return serverId;
    }

    public void setServerId(int serverId) {
        this.serverId = serverId;
    }

    public int getSalesType() {
        return salesType;
    }

    public void setSalesType(int salesType) {
        this.salesType = salesType;
    }

    public String getServerName() {
        return serverName;
    }

    public void setServerName(String serverName) {
        this.serverName = serverName;
    }

    public String getGradeName() {
        return gradeName;
    }

    public void setGradeName(String gradeName) {
        this.gradeName = gradeName;
    }

    public String getPeriodName() {
        return periodName;
    }

    public void setPeriodName(String periodName) {
        this.periodName = periodName;
    }

    public String getSubjectName() {
        return subjectName;
    }

    public void setSubjectName(String subjectName) {
        this.subjectName = subjectName;
    }

    public int getBookType() {
        return bookType;
    }

    public void setBookType(int bookType) {
        this.bookType = bookType;
    }

    public int getTeamId() {
        return teamId;
    }

    public void setTeamId(int teamId) {
        this.teamId = teamId;
    }

    public String getTeamName() {
        return teamName;
    }

    public void setTeamName(String teamName) {
        this.teamName = teamName;
    }

    public int getProvId() {
        return provId;
    }

    public void setProvId(int provId) {
        this.provId = provId;
    }

    public String getProvName() {
        return provName;
    }

    public void setProvName(String provName) {
        this.provName = provName;
    }

    public int getCityId() {
        return cityId;
    }

    public void setCityId(int cityId) {
        this.cityId = cityId;
    }

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    public int getPeriod() {
        return period;
    }

    public void setPeriod(int period) {
        this.period = period;
    }

    public int getSubjectId() {
        return subjectId;
    }

    public void setSubjectId(int subjectId) {
        this.subjectId = subjectId;
    }

    public boolean isAdded() {
        return isAdded;
    }

    public void setAdded(boolean added) {
        isAdded = added;
    }

    public int getGrade() {
        return grade;
    }

    public void setGrade(int grade) {
        this.grade = grade;
    }

    public int getSort() {
        return sort;
    }

    public void setSort(int sort) {
        this.sort = sort;
    }


    public long getLength() {
        return length;
    }

    public void setLength(long length) {
        this.length = length;
    }

    public String getProductId() {
        return productId;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public String getBookIntro() {
        return bookIntro;
    }

    public void setBookIntro(String bookIntro) {
        this.bookIntro = bookIntro;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public String getPackageId() {
        return packageId;
    }

    public void setPackageId(String packageId) {
        this.packageId = packageId;
    }

    public int getAppId() {
        return appId;
    }

    public void setAppId(int appId) {
        this.appId = appId;
    }

    public int getPackageType() {
        return packageType;
    }

    public void setPackageType(int packageType) {
        this.packageType = packageType;
    }

    //判断服务权限服务列表
    public static class Server extends BaseBean {

        //        private static final long serialVersionUID = -6797177556595267155L;
        private int id;

        private String name;
        //服务logo
        private String logo; //服务logo
        private String desc; //服务描述
        private String area; //服务适用地区
        private String period; //服务适用学段
        private int sign; //购买模式（0：月份 1：买断）
        private List<ServerPrice> price; //原始价格（买断模式，取数组第一个价格）
        private int buycount; //购买人数
        private boolean ispromo; //服务是否促销
        private ServerPromotion promotion; //促销实体

        private int required;// 考试用书


        public int getRequired() {
            return required;
        }

        public void setRequired(int required) {
            this.required = required;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public void setPrice(List<ServerPrice> price) {
            this.price = price;
        }

        public void setSign(int sign) {
            this.sign = sign;
        }

        public void setArea(String area) {
            this.area = area;
        }

        public void setBuycount(int buycount) {
            this.buycount = buycount;
        }

        public void setDesc(String desc) {
            this.desc = desc;
        }

        public void setIspromo(boolean ispromo) {
            this.ispromo = ispromo;
        }

        public void setLogo(String logo) {
            this.logo = logo;
        }

        public void setPeriod(String period) {
            this.period = period;
        }

        public void setPromotion(ServerPromotion promotion) {
            this.promotion = promotion;
        }

        public int getSign() {
            return sign;
        }

        public int getBuycount() {
            return buycount;
        }

        public List<ServerPrice> getPrice() {
            return price;
        }

        public ServerPromotion getPromotion() {
            return promotion;
        }

        public String getArea() {
            return area;
        }

        public String getDesc() {
            return desc;
        }

        public String getLogo() {
            return logo;
        }

        public String getPeriod() {
            return period;
        }
    }

    public static class Price extends BaseBean {
        //        private static final long serialVersionUID = 3070383858625491190L;
        private int month; //月份数
        private int sign; //是否买断
        private double oprice; //原始价格
        private double dprice; //促销价格

        public void setDprice(double dprice) {
            this.dprice = dprice;
        }

        public void setMonth(int month) {
            this.month = month;
        }

        public void setOprice(double oprice) {
            this.oprice = oprice;
        }

        public void setSign(int sign) {
            this.sign = sign;
        }

        public double getDprice() {
            return dprice;
        }

        public double getOprice() {
            return oprice;
        }

        public int getMonth() {
            return month;
        }

        public int getSign() {
            return sign;
        }
    }


    public static class ServerPrice extends BaseBean {
        //        private static final long serialVersionUID = 2636187334897034308L;
        private int serviceId; //服务ID
        private double price; //价格
        private int unit; //月数
        private String unitName; //单位
        private double oprice; //原始价格
        private double dprice; //促销价格
        private int month; //月份数
        private int sign; //是否买断

        public void setOprice(double oprice) {
            this.oprice = oprice;
        }

        public void setDprice(double dprice) {
            this.dprice = dprice;
        }

        public void setMonth(int month) {
            this.month = month;
        }

        public void setSign(int sign) {
            this.sign = sign;
        }

        public void setPrice(double price) {
            this.price = price;
        }

        public void setServiceId(int serviceId) {
            this.serviceId = serviceId;
        }

        public void setUnit(int unit) {
            this.unit = unit;
        }

        public void setUnitName(String unitName) {
            this.unitName = unitName;
        }

        public double getPrice() {
            return price;
        }

        public int getServiceId() {
            return serviceId;
        }

        public int getUnit() {
            return unit;
        }

        public String getUnitName() {
            return unitName;
        }

        public double getDprice() {
            return dprice;
        }

        public double getOprice() {
            return oprice;
        }

        public int getMonth() {
            return month;
        }

        public int getSign() {
            return sign;
        }
    }

    public static class ServerPromotion extends BaseBean {
        //        private static final long serialVersionUID = 1233501031925221445L;
        private String startTime; //起始时间
        private String endTime; //结束时间
        private List<Price> price; //促销价格
        private int scope; //促销范围（0：全部服务 1:用户 2.班级 3.学校 4.区域）

        public void setEndTime(String endTime) {
            this.endTime = endTime;
        }

        public void setScope(int scope) {
            this.scope = scope;
        }

        public void setStartTime(String startTime) {
            this.startTime = startTime;
        }

        public int getScope() {
            return scope;
        }

        public String getEndTime() {
            return endTime;
        }

        public String getStartTime() {
            return startTime;
        }

        public void setPrice(List<Price> price) {
            this.price = price;
        }

        public List<Price> getPrice() {
            return price;
        }
    }


    /**
     * 平台ID
     *
     * @author bin
     */
    public static class AppId {
        /**
         * 平台ID:6v68平台
         */
        public static final int APP_ID_6V68 = 200002;

        /**
         * 平台ID:校本平台
         */
        public static final int APP_ID_SCHOOL = 200003;

    }

    /**
     * 资源包类型
     */
    public static class PackageType {
        /**
         * 资源包类型:电子书
         */
        public static final int PACKAGE_TYPE_EBOOK = 1;

        /**
         * 资源包类型:趣配音
         */
        public static final int PACKAGE_TYPE_DUBING = 2;
        /**
         * 资源包类型:电子报
         */
        public static final int PACKAGE_TYPE_EPAPER = 3;
    }

    @Override
    public boolean equals(Object o) {
        return packageId.equals(((EpaperInfo) o).getPackageId());
    }
}
